<?php
/**
 * Created by PhpStorm.
 * User: lijing
 * Date: 2024/2/21
 * Time: 23:12
 * Lijing
 */


// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::group(function () {

    Route::group('user' , function (){
        Route::get('/', 'app\admin\controller\Users@index');

        Route::get('me', 'app\admin\controller\Users@read');
        Route::get('delete/:id', 'app\admin\controller\Users@delete');
        Route::post('update', 'app\admin\controller\Users@update');
        Route::post('create', 'app\admin\controller\Users@create');
        Route::get('logout', 'app\admin\controller\Auth@logout');
    });

    Route::group('role' , function (){
        Route::get('/', 'app\admin\controller\Role@index');
        Route::post('/create', 'app\admin\controller\Role@create');
        Route::get('/read/:id', 'app\admin\controller\Role@read');
        Route::post('/update/:id', 'app\admin\controller\Role@update');

    });

    Route::group('menu' , function (){
        Route::get('/', 'app\admin\controller\Menu@index');
        Route::post('/create', 'app\admin\controller\Menu@create');
        Route::get('/read/:id', 'app\admin\controller\Menu@read');
        Route::post('/update/:id', 'app\admin\controller\Menu@update');
    });
})->middleware(app\middleware\AdminAuth::class);

Route::post('login', 'app\admin\controller\Auth@login');
Route::post('/file/upload/img', 'app\admin\controller\Auth@login');
